package com.iss.okair.db.mapper;

import com.iss.okair.db.entity.AssetsPermanent;
import com.iss.okair.db.entity.AssetsTranUse;
import com.iss.okair.db.entity.Assetstrans;
import com.iss.okair.db.mapper.transsql.PermanentTransSQL;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

public interface PermanentTransMapper {

    @SelectProvider(type = PermanentTransSQL.class,method = "select")
    List<AssetsTranUse> select(AssetsTranUse model);
    @SelectProvider(type = PermanentTransSQL.class,method = "selectout")
    List<AssetsTranUse> selectout(AssetsTranUse model);
    @Select("select * from alltranslist where assetsid=#{assetsid}")
    List<AssetsTranUse> selectrecord(String model);

    //入库添加
    //入库添加
    @Insert("insert into assetstrans values(#{id},#{assetsid},#{batchno},#{transtype},#{count},#{price},#{handleremp},#{instocktime},#{targetemp},#{comment},NOW(),#{createuser})")
    int add(Assetstrans trans);

    //查询全部记录的方法
    @Select("select count(*) from assetstrans")
    int countALL();
}
